Module-level declarations

Functions

Link copied to clipboard
function map_citizen(    citizen: citizen): (account_id: byte_array, type: citizen_types, created_at: integer, wallet_address: byte_array, (total_proposals: big_integer, total_votes: big_integer))
Link copied to clipboard
function map_citizen_statistics(    citizen_statistics: citizen_statistics): (total_proposals: big_integer, total_votes: big_integer)

Queries

Link copied to clipboard
@mount("citizens.get_citizen") query get_citizen(account_id: byte_array): (account_id: byte_array, type: citizen_types, created_at: integer, wallet_address: byte_array, (total_proposals: big_integer, total_votes: big_integer))?

Retrieves a citizen's details based on the provided account ID.

Link copied to clipboard
@mount("citizens.get_citizen_statistics") query get_citizen_statistics(account_id: byte_array): (total_proposals: big_integer, total_votes: big_integer)?

Retrieves statistics for a citizen based on the provided account ID. The query is used to retrieve and format statistical data for the specified citizen account.

Link copied to clipboard
@mount("citizens.get_citizens") query get_citizens(page_cursor: text): paged_result

Retrieves a paginated list of citizens. The query is used to fetch and navigate through a large list of citizens in the paginated format.

Link copied to clipboard
@mount("citizens.get_register_message") query get_register_message(evm_address: byte_array): text

Retrieves the registration message for a given Ethereum address.

Link copied to clipboard
@mount("citizens.is_councilor_or_admin") query is_councilor_or_admin(account_id: byte_array): boolean

Checks if a given account ID belongs to a councilor or an admin. The query is used to determine the role and access level of a specific account.

Operations

Link copied to clipboard
@mount("citizens.register_admin") operation register_admin()

Authenticates the requester, checks if they have admin privileges, and then registers a new admin if the requester is authorized.

This opearation takes no parameter.

Link copied to clipboard
@mount("citizens.register_citizen") operation register_citizen()

Registers a new citizen, sets up their account and statistics, verifies their registration eligibility, and performs additional steps such as creating a cooldown proposal and snapshots of their balances.

This opearation takes no parameter for registering a citizen.

Link copied to clipboard
@mount("citizens.register_citizen_auth_server") operation register_citizen_auth_server(auth_descriptor: auth_descriptor, signature: signature)

Registers citizens by using auth server.

This opearation takes multiple parameters.

Link copied to clipboard
@mount("citizens.update_citizen_cooldowns_config") operation update_citizen_cooldowns_config(draft_cooldown_in_days: integer, rejection_cooldown_in_days: integer, veto_cooldown_in_days: integer)

Updates the cooldown configurations for citizen operations, including draft, rejection, and veto cooldown periods. This operation requires admin privileges and takes multiple parameters.

Link copied to clipboard
@mount("citizens.update_citizen_type") operation update_citizen_type(account_id: byte_array, new_type: citizen_types)

Changes the type of a citizen.

This opearation takes two parameters.